home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 March
/
CMCD0305.ISO
/
Software
/
Shareware
/
Utilitare
/
emu
/
Emu8086_Setup_307c.exe
/
{app}
/
Samples
/
scasb.asm
< prev
next >
Wrap
Assembly Source File
|
2002-08-02
|
728b
|
57 lines
; This sample shows how
; to use SCASB instruction
; to find a symbol.
#make_COM#
; COM file is loaded at 100h
; prefix:
ORG 100h
; set forward direction:
CLD
; set counter to string size:
MOV CX, 10
; load string address
; into ES:DI
MOV AX, CS
MOV ES, AX
LEA DI, str1
; we will look for the 'C'
; character in string:
MOV AL, 'C'
REPNE SCASB
JZ found
not_found:
; "No" - not found!
MOV AL, 'N'
MOV AH, 0Eh
INT 10h
JMP exit_here
found:
; "Yes" - found!
MOV AL, 'Y'
MOV AH, 0Eh
INT 10h
; DI contains the
; offset of 'C' character:
DEC DI
exit_here:
RET
str1 DB 'AAABBBCDDD'
END